#include "world.h"
#include "coid/comm/token.h"

static token _class_id = "W";
static token _class_name = "World";

const token& World::class_id() const { return _class_id; }
const token& World::class_name() const { return _class_name; }

void World::dispatch( const uchar* pc, const uchar* pe )
{
	while(pc<pe) {
		uchar cmd = *pc++;
		if( cmd == 0 )
		{
			uchar a0 = *(uchar*)pc;		pc += sizeof(a0);
			uint a1 = *(uint*)pc;		pc += sizeof(a1);
			((World*)this)->set_gamestate( a0, a1 );
		}
		else DASSERT(0); //command id out-of-range
	}
}
